﻿using System;
using System.Windows.Forms;
using Storm.TextEditor.Editor;
namespace Moonlite.ExtensionApi {
    public static class TextEditorEvents {
        public static event KeyEventHandler KeyDown;
        public static event KeyPressEventHandler KeyPress;
        public static event KeyEventHandler KeyUp;
        public static event MouseEventHandler MouseClick;
        public static event MouseEventHandler MouseDoubleClick;
        public static event MouseEventHandler MouseDown;
        public static event EventHandler MouseEnter;
        public static event EventHandler MouseHover;
        public static event EventHandler MouseLeave;
        public static event MouseEventHandler MouseMove;
        public static event MouseEventHandler MouseUp;
        public static event WordMouseHandler WordMouseDown;
        public static event WordMouseHandler WordMouseHover;
        public static event CopyHandler ClipboardUpdated;
        public static event EventHandler CaretChanged;
        public static event EventHandler FileNameChanged;
        public static event EventHandler FileSavedChanged;
        public static event EventHandler SelectionChanged;
        public static event RowPaintHandler RenderRow;
        public static event RowMouseHandler RowClick;
        public static event RowMouseHandler RowDoubleClick;
        public static event RowMouseHandler RowMouseDown;
        public static event RowMouseHandler RowMouseMove;
        public static event RowMouseHandler RowMouseUp;
        public static event DragEventHandler DragDrop;
        public static event DragEventHandler DragEnter;
        public static event EventHandler DragLeave;
        public static event DragEventHandler DropOver;
        public static void OnKeyDown(KeyEventArgs ea) {
            KeyEventHandler handler = KeyDown;
            if (null != handler)
                handler(null, ea);
        }
        public static void OnKeyPress(KeyPressEventArgs ea) {
            KeyPressEventHandler handler = KeyPress;
            if (null != handler)
                handler(null, ea);
        }
        public static void OnKeyUp(KeyEventArgs ea) {
            KeyEventHandler handler = KeyUp;
            if (null != handler)
                handler(null, ea);
        }
        public static void OnMouseClick(MouseEventArgs ea) {
            MouseEventHandler handler = MouseClick;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseDoubleClick(MouseEventArgs ea) {
            MouseEventHandler handler = MouseDoubleClick;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseDown(MouseEventArgs ea) {
            MouseEventHandler handler = MouseDown;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseEnter(EventArgs ea) {
            EventHandler handler = MouseEnter;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseHover(EventArgs ea) {
            EventHandler handler = MouseHover;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseLeave(EventArgs ea) {
            EventHandler handler = MouseLeave;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseMove(MouseEventArgs ea) {
            MouseEventHandler handler = MouseMove;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnMouseUp(MouseEventArgs ea) {
            MouseEventHandler handler = MouseUp;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnWordMouseDown(WordMouseEventArgs ea) {
            WordMouseHandler handler = WordMouseDown;
            if (handler != null)
                handler(null, ref ea);
        }
        public static void OnWordMouseHover(WordMouseEventArgs ea) {
            WordMouseHandler handler = WordMouseHover;
            if (handler != null)
                handler(null, ref ea);
        }
        public static void OnClipboardUpdated(CopyEventArgs ea) {
            CopyHandler handler = ClipboardUpdated;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnCaretChanged(EventArgs ea) {
            EventHandler handler = CaretChanged;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnFileNameChanged(EventArgs ea) {
            EventHandler handler = FileNameChanged;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnFileSavedChanged(EventArgs ea) {
            EventHandler handler = FileSavedChanged;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnSelectionChanged(EventArgs ea) {
            EventHandler handler = SelectionChanged;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnRenderRow(RowPaintEventArgs ea) {
            RowPaintHandler handler = RenderRow;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnRowMouseDown(RowMouseEventArgs ea) {
            RowMouseHandler handler = RowMouseDown;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnRowMouseMove(RowMouseEventArgs ea) {
            RowMouseHandler handler = RowMouseMove;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnRowMouseUp(RowMouseEventArgs ea) {
            RowMouseHandler handler = RowMouseUp;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnRowClick(RowMouseEventArgs ea) {
            RowMouseHandler handler = RowClick;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnRowDoubleClick(RowMouseEventArgs ea) {
            RowMouseHandler handler = RowDoubleClick;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnDragDrop(DragEventArgs ea) {
            DragEventHandler handler = DragDrop;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnDragEnter(DragEventArgs ea) {
            DragEventHandler handler = DragEnter;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnDragLeave(EventArgs ea) {
            EventHandler handler = DragLeave;
            if (handler != null)
                handler(null, ea);
        }
        public static void OnDropOver(DragEventArgs ea) {
            DragEventHandler handler = DropOver;
            if (handler != null)
                handler(null, ea);
        }
    }
}
